/**
 * Copyright (c) 2013-Now http://jeesite.com All rights reserved.
 */
package com.jeesite.modules.edu.entity;

import javax.validation.constraints.NotBlank;
import org.hibernate.validator.constraints.Length;

import com.jeesite.common.entity.DataEntity;
import com.jeesite.common.entity.TreeEntity;
import com.jeesite.common.mybatis.annotation.Column;
import com.jeesite.common.mybatis.annotation.Table;
import com.jeesite.common.mybatis.mapper.query.QueryType;

/**
 * 国民经济行业分类Entity
 * @author 赵俊飞
 * @version 2019-03-01
 */
@Table(name="edu_industry", alias="a", columns={
		@Column(name="tree_code", attrName="treeCode", label="tree_code", isPK=true),
		@Column(includeEntity=TreeEntity.class),
		@Column(name="tree_name", attrName="treeName", label="tree_name", queryType=QueryType.LIKE,isTreeName=true),
		@Column(name="tree_type", attrName="treeType", label="tree_type"),
		@Column(includeEntity=DataEntity.class),
	}, orderBy="a.tree_sorts, a.tree_code"
)
public class EduIndustry extends TreeEntity<EduIndustry> {
	
	private static final long serialVersionUID = 1L;
	private String treeCode;		// tree_code
	private String treeName;		// tree_name
	private String treeType;		// tree_type
	
	public EduIndustry() {
		this(null);
	}

	public EduIndustry(String id){
		super(id);
	}
	
	@Override
	public EduIndustry getParent() {
		return parent;
	}

	@Override
	public void setParent(EduIndustry parent) {
		this.parent = parent;
	}
	
	public String getTreeCode() {
		return treeCode;
	}

	public void setTreeCode(String treeCode) {
		this.treeCode = treeCode;
	}
	
	@NotBlank(message="tree_name不能为空")
	@Length(min=0, max=100, message="tree_name长度不能超过 100 个字符")
	public String getTreeName() {
		return treeName;
	}

	public void setTreeName(String treeName) {
		this.treeName = treeName;
	}
	
	@Length(min=0, max=1, message="tree_type长度不能超过 1 个字符")
	public String getTreeType() {
		return treeType;
	}

	public void setTreeType(String treeType) {
		this.treeType = treeType;
	}

	@Override
	public String toString() {
		if(treeName!=null) {
			return treeName;
		}
		return "";
	}
	
}